mixin level(level)
  if level
    - var levelMap = { base: "基础", advance: "进阶", senior: "资深" }
    .level
      each levelValue, levelIndex in level
        - var levelTitle = levelMap[levelIndex] || '要求'
        dl.level-item
          dt= levelTitle
          dd!= marked(levelValue)

mixin reference(reference)
  .reference
    if reference
      h2 参考资料
      ul
        for refUrl, refTitle in reference
          li
            a(href=refUrl, target="_blank")= refTitle

mixin links(point)
  if point.github || point.homepage
    .links
      if point.github
        a.button(href=point.github, target="_blank")
          span.icon-github-sign
          | Github
      if point.homepage
        a.button(href=point.homepage, target="_blank")
          span.icon-home
          | 官网

mixin desc(desc)
  if desc
    .desc!= marked(desc)

mixin app-menu-item(title, url, blank, icon)
  li(class= title == active ? 'active' : null)
    a(href=url, target=blank)
      if icon
        span(class='icon-' + icon)
      = title
